<?php

class My_Filter_EmailDPF implements Zend_Filter_Interface
{
    public function filter($value)
    {
        $pattern = '/(([-_.0-9a-zA-Z]{1,30})@([A-Za-z0-9]{1,30}.[A-Za-z0-9]{1,30}[.A-Za-z0-9]{0,30}))/i';
        $result = preg_match($pattern, $value,$matches);
        if($result){
            $email = $matches[1];
            return $email;
        } 
        return null;
    }
}
